package com.tj.bo.trade.client.enums;

/**
 * @program: binary-option
 * @description
 * @author: binary
 * @create: 2020-07-31 11:52
 **/
public enum ProfitReminderEnum {

    ZERO(0, "Come on, you will win next time!"), GOOD(1, "Good Job"), GREAT(2,"Great"), AMAZING(3,"Amazing"), EXCELLENT(4,"Excellent"), CRAZY(5,"Crazy"), UNBELIEVABLE(6,"Unbelievable");


    ProfitReminderEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public ProfitReminderEnum setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getName() {
        return name;
    }

    public ProfitReminderEnum setName(String name) {
        this.name = name;
        return this;
    }

    public static ProfitReminderEnum getEnumByCode(Integer code){
        ProfitReminderEnum profitReminderEnum = ProfitReminderEnum.UNBELIEVABLE;
        if(code != null){
            for(ProfitReminderEnum typeEnum : ProfitReminderEnum.values()){
                if(code == typeEnum.getCode()){
                    profitReminderEnum = typeEnum;
                    break;
                }
            }
        }
        return profitReminderEnum;

    }
}
